home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 3.3 KB | 104 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWRegion.h
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWREGION_H
- #define FWREGION_H
-
- #ifndef FWGCONST_H
- #include "FWGConst.h"
- #endif
-
- #ifndef SLREGION_H
- #include "SLRegion.h"
- #endif
-
- //========================================================================================
- // Platform Region functions
- //========================================================================================
-
- // ----- Equality -----
- FW_Boolean FW_IsEqualRegion(ODRgnHandle rgn1, ODRgnHandle rgn2);
-
- // ----- Region Operations -----
- void FW_UnionRegion(ODRgnHandle rgn1, ODRgnHandle rgn2, ODRgnHandle dstRgn);
- void FW_XorRegion(ODRgnHandle rgn1, ODRgnHandle rgn2, ODRgnHandle dstRgn); // rgn1 - rgn2
- void FW_SubtractRegion(ODRgnHandle rgn1, ODRgnHandle rgn2, ODRgnHandle dstRgn);
- void FW_IntersectRegion(ODRgnHandle rgn1, ODRgnHandle rgn2, ODRgnHandle dstRgn);
-
- //========================================================================================
- // inlines
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_IsEqualRegion
- //----------------------------------------------------------------------------------------
-
- inline FW_Boolean FW_IsEqualRegion(ODRgnHandle rgn1, ODRgnHandle rgn2)
- {
- return ::EqualRgn(rgn1, rgn2);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_UnionRegion
- //----------------------------------------------------------------------------------------
-
- inline void FW_UnionRegion(ODRgnHandle rgn1, ODRgnHandle rgn2, ODRgnHandle dstRgn)
- {
- #ifdef FW_BUILD_MAC
- ::UnionRgn(rgn1, rgn2, dstRgn);
- #endif
- #ifdef FW_BUILD_WIN
- ::CombineRgn(dstRgn, rgn1, rgn2, RGN_OR);
- #endif
- }
-
- //----------------------------------------------------------------------------------------
- // FW_XorRegion
- //----------------------------------------------------------------------------------------
-
- inline void FW_XorRegion(ODRgnHandle rgn1, ODRgnHandle rgn2, ODRgnHandle dstRgn)
- {
- #ifdef FW_BUILD_MAC
- ::XorRgn(rgn1, rgn2, dstRgn);
- #endif
- #ifdef FW_BUILD_WIN
- ::CombineRgn(dstRgn, rgn1, rgn2, RGN_XOR);
- #endif
- }
-
- //----------------------------------------------------------------------------------------
- // FW_SubtractRegion
- //----------------------------------------------------------------------------------------
-
- inline void FW_SubtractRegion(ODRgnHandle rgn1, ODRgnHandle rgn2, ODRgnHandle dstRgn)
- {
- #ifdef FW_BUILD_MAC
- ::DiffRgn(rgn1, rgn2, dstRgn);
- #endif
- #ifdef FW_BUILD_WIN
- ::CombineRgn(dstRgn, rgn1, rgn2, RGN_DIFF);
- #endif
- }
-
- //----------------------------------------------------------------------------------------
- // FW_IntersectRegion
- //----------------------------------------------------------------------------------------
-
- inline void FW_IntersectRegion(ODRgnHandle rgn1, ODRgnHandle rgn2, ODRgnHandle dstRgn)
- {
- #ifdef FW_BUILD_MAC
- ::SectRgn(rgn1, rgn2, dstRgn);
- #endif
- #ifdef FW_BUILD_WIN
- ::CombineRgn(dstRgn, rgn1, rgn2, RGN_AND);
- #endif
- }
-
- #endif
-